Skip to content

Executable tutorial proposal: LLMOps prompt regression testing - #2967

Merged
frankreyesgarcia merged 1 commit into
KTH:2026from
LeuisKen:tutorial-jiaxun-jingze
Sep 10, 2026
Merged

frankreyesgarcia merged 1 commit into
KTH:2026from
LeuisKen:tutorial-jiaxun-jingze

Conversation

@LeuisKen

@LeuisKen LeuisKen commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Assignment Proposal

Title

Prompt regression testing for LLM applications (LLMOps)

Names and KTH ID

Deadline

  • Task 2

Category

  • Executable tutorial

Description

We want to write a Google Colab notebook that shows how to keep an LLM application stable when its prompt or its model changes. The reader writes a promptfoo configuration with test cases and assertions, runs it against a small instruction-tuned model that is loaded locally in the notebook. The reader then breaks the prompt on purpose, watches the assertions fail, and finally wires the evaluation into a pipeline, so that a failed evaluation blocks the change.

Relevance

An LLM application is defined as much by its prompts and its model version as by its code, and both change often. Without evaluation, a reworded prompt or a model upgrade can silently degrade behaviour, which is the LLMOps version of a regression. The tutorial makes that behaviour testable and automated, so that changes to a model-driven system get the same review discipline as changes to code.

@PierreSegerstrom

Copy link
Copy Markdown
Contributor

Hello!
Me (pise@kth.se) and De Chi Hao (dchao@kth.se) have gotten approval from the authors of this PR (over e-mail) that we will give feedback on their finished result. Once this PR has been merged, we will open our own "Feedback Task PR" accordingly.

@LeuisKen

LeuisKen commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@PierreSegerstrom Yes, sure. But I think we need to have this PR merged first :D

@LeuisKen

LeuisKen commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@frankreyesgarcia any review, please?

@LeuisKen
LeuisKen force-pushed the tutorial-jiaxun-jingze branch from 2b34946 to 3685426 Compare September 9, 2026 17:04
@LeuisKen
LeuisKen force-pushed the tutorial-jiaxun-jingze branch from 3685426 to 72ebb82 Compare September 9, 2026 17:08
@frankreyesgarcia
frankreyesgarcia merged commit 9f60045 into KTH:2026 Sep 10, 2026
5 checks passed
@JingzeGuo

Copy link
Copy Markdown

@PierreSegerstrom We've finished the tutorial! I'll send you the link by email, and you can start on the feedback.

@PierreSegerstrom

PierreSegerstrom commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@JingzeGuo Thank you, we received your email, and I was able to open the Google Colab notebook 🙌🏻

We'll get to it, and get back here with the feedback! (edit: by Wednesday EOD)

@PierreSegerstrom

Copy link
Copy Markdown
Contributor

Feedback

No Account

The executable tutorial is built on a Google Colab environment, indicating that it is reproducible, as we only need a free Google account to make a copy of the ipynb file. This made it very easy for us to get into, requiring no setup.

One tiny tweak to make it even clearer, is to put the “execution note” at the very beginning, under your names for example. It fits better there, since during reading the “Motivation”, the thought came to mind: “will we need to consider any special setup?”

Executability

The tutorial is fully automated, as running the "Run All" command executes all steps in sequence. The total execution time taken was approximately 7 minutes.

Technical Depth

The tutorial indeed implements a non-trivial DevOps workflow involving integrations such as Node.js CLI(promptfoo), a local Python model interface (Qwen2.5-0.5B-Instruct), declarative test suites and a structural assertions YAML config file, and the GitHub Actions CI automation quality gate.

Relevance

Yes, the authors clearly laid out in the first “Motivation” section. The tutorial mentioned how it reflects the standard DevOps practice of Automated regression testing as a CI quality gate. They are using this concept to address the prompt drift issue, preventing the potential consequences of a broken downstream schema contract and a degradation of output quality.

The authors make a good case for why this is important in the beginning of the tutorial. One possible addition to the “Motivation” section of the notebook to really “hit the nail”, is to also give a quick example for what could go wrong if we allowed “prompt drift” to happen. Answering the question: “Is it really that big of a deal?”. You do show this through the failed tests later on, but a quick justifying sentence in the beginning can be a nice addition.

System Reasoning

The tutorial clearly explained how different components collaborate, including the promptfooconfig.yaml, provider.py, and CLI evaluation tool. It was a nice detail how provider.py acts as an interface, so that it can be easily switched out to a hosted API later.

Design Decisions

The tutorial leaves a markdown chapter, Design Decisions and Tooling Rationale, which clearly shows the reasons for their choice of programming tools and architecture. For example, the reasons for why it chose local open-weights models due to its no API costs and reproducibility, etc. The choice of using examples from a standard dataset was a nice touch!

Reflection

The tutorial markdown chapter titled Who This Fits, Limitations and Practical Considerations clearly reflects on the cases in which this tutorial approach can be useful, which other two situations might not, and its Limitations and Practical Considerations. This section about “applicable scenarios” was particularly useful to understand the application this. While reading, we already envisioned how this could be applied in a hypothetical LLMOps pipeline.

Narrative/Structure

The overall structure was concise and clear. It follows a standard timeline from Motivation, Setup, Steps, Outcome, and reflection. Even though there are multiple steps to follow, we find it structured in a way that we don’t lose track of the bigger picture. we also found it good that you first showed the “good example” and explained it well, so when the “bad example” was introduced, we were encouraged to reflect upon what would now change.

Visuals

The tutorial uses the Mermaid architecture diagram and includes a bar chart summarizing test pass and fail statistics using matplotlib. Although the output from “promptfoo” itself was enough to understand what happened in the tests, the added graph visualization in step 5 conceptually guided me as a reader that we would go from “good example” (green) to “bad example” (red).

Language

The overall language used in this article was well written, clear, and structured. A great addition is that some of the keywords were highlighted in bold text, which made it easier for me to understand.

ILO

The intended learning outcomes are clearly stated at the top of the tutorial. After completing the tutorial, four LLMOps skills can be introduced. While reading the ILOs, We felt encouraged to carry out the tutorial, since I’m presented with the actual outcomes of the tutorial (what kinds of insights/knowledge/learnings we can carry with us afterwards). It is common that ILOs are phrased very “high level”, which can make the reader less engaged since they aren’t concrete enough. You’ve planned out the contents of this tutorial well, nice job!

Certification

I/We certify that generative AI, incl. ChatGPT, has not been used to write this feedback. Using generative AI without permission is considered academic misconduct.

De Chi Hao (dchao@kth.se) and Pierre Segerström (pise@kth.se)

@JingzeGuo

Copy link
Copy Markdown

@PierreSegerstrom Thanks for the detailed feedback! We’ll revise it following your suggestions in the final version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tutorial One of the task categories listed in README.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants